# -*- coding: utf-8 -*-
"""
 @Time    : 2021/2/24 下午5:49
 @Author  : tgy
 
"""


def value_two(obj):
    return obj.value * 2


class Extra(type):

    def __new__(cls, classname, superclasses, attributedict):
        ...
        attributedict['value_two'] = value_two
        return type.__new__(cls, classname, superclasses, attributedict)


def wrapp_extra(classname, supperclasses,attributedict):
    ...
    attributedict['value_two'] = value_two
    return type(classname, supperclasses, attributedict)


class Person(metaclass=wrapp_extra):

    name = '111'
    def __init__(self, value):
        self.value = value


if __name__ == '__main__':
    ...

    print(Person.__dict__)
    person = Person(12)
    print(person.value_two())
